/**
 * 
 */
package cn.jhz.filesharingsystem.model;

import java.util.HashSet;
import java.util.Set;

import com.fasterxml.jackson.annotation.JsonIgnore;



/**
  *  角色模型类
 * @author asus
 */
public class Role {
	private int id;
	private String roleName;
	private int fileCount;
	private Integer state; //1：正常，0：禁止
	private Set<Permission> permissions;
	private Set<User> users = new HashSet<>();
	/**
	 * @return the id
	 */
	public int getId() {
		return id;
	}
	/**
	 * @param id the id to set
	 */
	public void setId(int id) {
		this.id = id;
	}
	/**
	 * @return the roleName
	 */
	public String getRoleName() {
		return roleName;
	}
	/**
	 * @param roleName the roleName to set
	 */
	public void setRoleName(String roleName) {
		this.roleName = roleName;
	}
	/**
	 * @return the state
	 */
	public Integer getState() {
		return state;
	}
	/**
	 * @param state the state to set
	 */
	public void setState(Integer state) {
		this.state = state;
	}
	/**
	 * @return the permissions
	 */
	public Set<Permission> getPermissions() {
		return permissions;
	}
	/**
	 * @param permissions the permissions to set
	 */
	public void setPermissions(Set<Permission> permissions) {
		this.permissions = permissions;
	}
	/**
	 * @return the users
	 */
	@JsonIgnore
	public Set<User> getUsers() {
		return users;
	}
	/**
	 * @param users the users to set
	 */
	@JsonIgnore
	public void setUsers(Set<User> users) {
		this.users = users;
	}
	/**
	 * @return the fileCount
	 */
	public int getfileCount() {
		return fileCount;
	}
	/**
	 * @param fileCount the fileCount to set
	 */
	public void setfileCount(int fileCount) {
		this.fileCount = fileCount;
	}
	@Override
	public String toString() {
		return "Role [id=" + id + ", roleName=" + roleName + ", fileCount=" + fileCount + ", state=" + state + "]";
	}
}
